services:
- docker
+git:
+ depth: 1
+
matrix:
include:
# stable linux builds, tested
ALT=i686-unknown-linux-gnu
IMAGE=dist
MAKE_TARGETS="test distcheck doc install uninstall"
+ ALLOW_PR=1
- env: TARGET=i686-unknown-linux-gnu
IMAGE=dist
MAKE_TARGETS=test-unit-i686-unknown-linux-gnu
sh -s -- --add-target=$ALT --disable-sudo -y --prefix=`rustc --print sysroot`;
fi
script:
- - if [ "$TRAVIS_OS_NAME" = "osx" ]; then
- SRC=. src/ci/run.sh $TARGET;
- else
- src/ci/docker/run.sh $IMAGE $TARGET;
- fi
+ - >
+ if [ "$ALLOW_PR" = "" ] && [ "$TRAVIS_BRANCH" != "auto-cargo" ]; then
+ echo skipping, not a full build;
+ elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
+ SRC=. src/ci/run.sh $TARGET;
+ else
+ src/ci/docker/run.sh $IMAGE $TARGET;
+ fi
+
after_success: |
[ $TRAVIS_BRANCH = master ] &&
[ $TRAVIS_PULL_REQUEST = false ] &&
email:
on_success: never
-branches:
- only:
- - master
- - auto-cargo
- - beta
- - stable
-
before_deploy:
- mkdir -p deploy/$TRAVIS_COMMIT
- cp target/$TARGET/release/dist/cargo-*-$TARGET.tar.gz
@mkdir -p $$(CFG_BUILD_DIR)/target/$(1)/cit
$$(CARGO) test --target $(1) \
--manifest-path $(S)Cargo.toml \
- $$(OPT_FLAG) $$(CARGOFLAGS) $$(VERBOSE_FLAG) $$(only)
+ $$(OPT_FLAG) $$(CARGOFLAGS) $$(VERBOSE_FLAG) $$(only) -- \
+ --quiet
endef
$(foreach target,$(CFG_TARGET),$(eval $(call CARGO_TARGET,$(target))))
environment:
matrix:
- TARGET: x86_64-pc-windows-gnu
- ARCH: amd64
BITS: 64
CFG_DISABLE_CROSS_TESTS: 1
MAKE_TARGETS: test-unit-x86_64-pc-windows-gnu
- TARGET: i686-pc-windows-gnu
- ARCH: x86
BITS: 32
MINGW_URL: https://s3.amazonaws.com/rust-lang-ci
MINGW_ARCHIVE: i686-4.9.2-release-win32-dwarf-rt_v4-rev4.7z
MAKE_TARGETS: test-unit-i686-pc-windows-gnu
- TARGET: i686-pc-windows-msvc
BITS: 32
- ARCH: x86
MAKE_TARGETS: test-unit-i686-pc-windows-msvc
CFG_DISABLE_CROSS_TESTS: 1
+ ALLOW_PR: 1
- TARGET: x86_64-pc-windows-msvc
OTHER_TARGET: i686-pc-windows-msvc
BITS: 64
- ARCH: amd64
MAKE_TARGETS: test-unit-x86_64-pc-windows-msvc
install:
- cargo -V
- git submodule update --init
+clone_depth: 1
+
build: false
test_script:
- C:\Users\appveyor\.cargo\registry
after_test:
- - mkdir %APPVEYOR_REPO_COMMIT%
+ - ps: New-Item -Path "${env:APPVEYOR_REPO_COMMIT}" -ItemType "directory"
+ - ps: New-Item -Path "target" -ItemType "directory" -Force
+ - ps: New-Item -Path "target/${env:TARGET}" -ItemType "directory" -Force
+ - ps: New-Item -Path "target/${env:TARGET}/release" -ItemType "directory" -Force
+ - ps: New-Item -Path "target/${env:TARGET}/release/dist" -ItemType "directory" -Force
- ps: Get-ChildItem -Path target\${env:TARGET}\release\dist -Filter '*.tar.gz' | Move-Item -Destination ${env:APPVEYOR_REPO_COMMIT}
-branches:
- only:
- - master
- - auto-cargo
- - beta
- - stable
-
artifacts:
- path: $(APPVEYOR_REPO_COMMIT)\cargo-*-$(TARGET).tar.gz
name: cargo
--env SRC=/checkout \
--env CARGO_HOME=/cargo \
--env TRAVIS_BRANCH=$TRAVIS_BRANCH \
+ --env TRAVIS_PULL_REQUEST_BRANCH=$TRAVIS_PULL_REQUEST_BRANCH \
+ --env ALLOW_PR=$ALLOW_PR \
+ --env CI=$CI \
--volume "$HOME/.cargo:/cargo" \
--volume `rustc --print sysroot`:/rust:ro \
--volume `pwd`/target:/tmp/target \
BRANCH=$TRAVIS_BRANCH
if [ "$BRANCH" = "" ]; then
- BRANCH=$APPVEYOR_BRANCH
+ BRANCH=$APPVEYOR_REPO_BRANCH
fi
if [ "$BRANCH" = "stable" ]; then
CHANNEL=dev
fi
+# We want to only run tests in a few situations:
+#
+# * All tests on the auto-cargo branch
+# * One test on PRs
+# * Any tests done locally
+#
+# This means that here if we're on CI, then we skip tests if it's not the right
+# branch or if we're not configured to run a test on PRs
+if [ -n "$CI" ] && [ "$BRANCH" != "auto-cargo" ] && [ "$ALLOW_PR" = "" ]; then
+ echo no build necessary, skipping
+ exit 0
+fi
+
$SRC/configure \
--prefix=/tmp/obj/install \
--target=$TARGET \